package net.zjitc.service.impl;

import net.zjitc.dao.UserMapper;
import net.zjitc.domain.User;
import net.zjitc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public Boolean addUser(User user) {
        return userMapper.insert(user) == 1;
    }

    @Override
    public Boolean delete(Integer id) {
        return userMapper.deleteById(id) == 1;
    }
    @Override
    public User findById(Integer id) {
        return userMapper.selectById(id);
    }
    @Override
    public void update(User user){
        userMapper.updateById(user);
    }
}
